import { _decorator, Component, Label, Node, Slider, Sprite, Toggle, Vec2, Vec3 } from 'cc';
import { UIManager } from '../UIManager';
import { LanauageManager } from '../LanauageManager';
import { GameData, inviteDetialData } from '../GameData';
import { HttpClient } from '../net/HttpClient';
import { EventManager } from '../EventManager';
import { AudioMgr } from '../AudioMgr';
import { Util } from '../Util';
const { ccclass, property } = _decorator;

@ccclass('myInviteItem')
export class myInviteItem extends Component {

    @property(Sprite)
    avatar:Sprite = null;

    @property(Label)
    nameLab:Label = null;

    @property(Label)
    coinLab:Label = null;

    @property(Label)
    coinLab2:Label = null;

    invitData:inviteDetialData;

    onEnable() {
        
    }

    refresh(itemData:any){
        this.invitData = itemData;

        this.nameLab.string = this.invitData.nickname;

        Util.loadRemoteUrl(GameData.getIns().userData.avatar, this.avatar);

        this.coinLab.string = this.invitData.inviteRewardSum;

        this.coinLab2.string = this.invitData.inviteRewardYesterday;
    }

    onClickHandler(event:Event, str:string){
        if (str == "share"){

        }else if (str == "save"){
            
        }
    }
}

